package mall.model.vo;

/*
 *
 * @author Yonni
 * @version 1.8.0_201
 * @date 2020-05-30 10:48
 *
 * */

import mall.model.enumaration.OrderStage;

/*
* 后台管理系用分页查询订单每个订单详情vo
* */
public class PageOrderInfoVO {
    private Integer id;
    private Integer userId;
    private Integer goodsDetailId;
    private String goods;
    private String spec;
    private Integer goodsNum;
    private Double amount;
    private Integer stateId;
    private String state;
    private PageOrderInfoUserVO user = new PageOrderInfoUserVO();

    //写四个set方法
    public void setNickname(String nickname) {
        user.setNickname(nickname);
    }
    public void setName(String name) {
        user.setName(name);
    }
    public void setAddress(String address) {
        user.setAddress(address);
    }
    public void setPhone(String phone) {
        user.setPhone(phone);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getGoodsDetailId() {
        return goodsDetailId;
    }

    public void setGoodsDetailId(Integer goodsDetailId) {
        this.goodsDetailId = goodsDetailId;
    }

    public String getGoods() {
        return goods;
    }

    public void setGoods(String goods) {
        this.goods = goods;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public Integer getGoodsNum() {
        return goodsNum;
    }

    public void setGoodsNum(Integer goodsNum) {
        this.goodsNum = goodsNum;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public Integer getStateId() {
        return stateId;
    }

    /*
    * 需要在这里做一些处理
    * dbutils是如何封装数据的？取出每列的列名id userId
    * 然后运用反射调用相应setId() setUserId()
    * */
    public void setStateId(Integer stateId) {
        if (stateId.equals(OrderStage.UN_PAID.getCode())) {
            setState(OrderStage.UN_PAID.getValue());
        }
        if (stateId.equals(OrderStage.UN_SHIPED.getCode())) {
            setState(OrderStage.UN_SHIPED.getValue());
        }
        if (stateId.equals(OrderStage.DELIVERED.getCode())) {
            setState(OrderStage.DELIVERED.getValue());
        }
        if (stateId.equals(OrderStage.RECEVIED.getCode())) {
            setState(OrderStage.RECEVIED.getValue());
        }
        this.stateId = stateId;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public PageOrderInfoUserVO getUser() {
        return user;
    }

    public void setUser(PageOrderInfoUserVO user) {
        this.user = user;
    }
}
